<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
	 <div class="header_phai">Liên kết website</div>
	<div class="box">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<?php
					$query="select * from advertisements where position='right' and state='on'";
					$result=mysql_query($query);
					$a=1;
					while($row=mysql_fetch_array($result)){?>
						<td>
							<a href="<?php echo $row['linkAdv'];?>" target="_blank"><img src="<?php echo substr($row['imgpath'],3);?>" width="198" height="275" border="0"></a>
						</td>	
					<?php
					if($a%1==0){
						echo "<tr></tr>";	
					}
					$a=$a+1;
				   }
					?>
			</tr>
		</table>
	</div>  
</body>
</html>
